package com.example.venue_reservation_service.repository;

import com.example.venue_reservation_service.entity.ChatMessage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.time.LocalDateTime;

public interface ChatMessageRepository extends MongoRepository<ChatMessage, String> {
    Page<ChatMessage> findByTimestampBeforeOrderByTimestampDesc(LocalDateTime before, Pageable pageable);
}